import request from '@/utils/request'

// 查询数据资产列表
export function getAssets(query) {
  return request({
    url: '/system/lineage/assets',
    method: 'get',
    params: query
  })
}

// 查询血缘关系列表
export function getLineageList(query) {
  return request({
    url: '/system/lineage/list',
    method: 'get',
    params: query
  })
}

// 获取血缘图谱数据
export function getLineageGraph(assetId, depth) {
  return request({
    url: '/system/lineage/graph',
    method: 'get',
    params: { assetId, depth }
  })
}

// 查询血缘关系详细
export function getLineage(lineageId) {
  return request({
    url: '/system/lineage/' + lineageId,
    method: 'get'
  })
}

// 新增血缘关系
export function addLineage(data) {
  return request({
    url: '/system/lineage',
    method: 'post',
    data: data
  })
}

// 修改血缘关系
export function updateLineage(data) {
  return request({
    url: '/system/lineage',
    method: 'put',
    data: data
  })
}

// 删除血缘关系
export function delLineage(lineageId) {
  return request({
    url: '/system/lineage/' + lineageId,
    method: 'delete'
  })
}
